home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 3 / Amoszine 3.adf / sticks_ext / Sticks.asc < prev    next >
Text File  |  1992-02-26  |  9KB  |  535 lines

  1.  
  2. TABLE OF CONTENTS
  3.  
  4. Sticks.lib/Multi Joy
  5. Sticks.lib/Multi Fire
  6. Sticks.lib/Stick Joy
  7. Sticks.lib/Stick Up
  8. Sticks.lib/Stick Down
  9. Sticks.lib/Stick Left
  10. Sticks.lib/Stick Right
  11. Sticks.lib/Stick Fire
  12. Sticks.lib/Stick Scan
  13. Sticks.lib/Stick X
  14. Sticks.lib/Stick Y
  15. Sticks.lib/Mouse X
  16. Sticks.lib/Mouse Y
  17. Sticks.lib/Mouse Button 
  18. Sticks.lib/Mouse Clip
  19. Sticks.lib/Mouse Area
  20.  
  21. Sticks.lib/Multi Joy            Sticks.lib/Multi Joy
  22.  
  23. NAME
  24.  
  25. state =Multi Joy (jport)
  26.  
  27. FUNCTION  
  28.   Reads the joystick and returns in state.
  29.   Unlike the original =Joy() command returns information on the state of 
  30.   four button (using adaptor two buttons with out).
  31.  
  32.   example:
  33.  
  34.   Do
  35.      J=Multi Joy(1)
  36.      Print Bin$(J)
  37.   Loop
  38.  
  39.   you will see that the high bits are for the buttons and the low bits
  40.   are for the direction.
  41.  
  42. INPUTS
  43.   jport - which joystick to read.
  44.       0 - Reads mouse port  
  45.       1 - Reads Joystick port
  46.    
  47. RESULT
  48.  
  49.   State of joystick 
  50.  
  51.                     76543210
  52.    Stick Info :     ABCDUDLR
  53.   
  54.   Bit Number     meaning
  55.  
  56.     1            Joystick moved up
  57.     2            Joystick moved down
  58.     4            Joystick moved left
  59.     8            Joystick moved right
  60.     16           Button D Pressed
  61.     32           Button C Pressed   
  62.     64           Button B Pressed (button on one button joystick)
  63.     128          Button A Pressed
  64.  
  65. BUGS
  66.  
  67.   none known
  68.  
  69. SEE ALSO
  70.  
  71.   Jleft , Jright , Jup , Jdown  (AMOS Manual)
  72.    
  73. Sticks.lib/Multi Fire         Sticks.lib/Multi Fire
  74.  
  75. NAME
  76.  
  77.   BOOL = Multi Fire (jport,button)
  78.  
  79. FUNCTION
  80.  
  81.   Tests 'jport' to see if 'Button' has been pressed .
  82.  
  83. INPUTS
  84.  
  85.   Button  -  This is the button you want to test
  86.              1=A 2=B  3=C 4=D (Start).
  87.   jport   -  which joystick port to read.
  88.              this should be either 0 or 1
  89.  
  90. RESULTS
  91.  
  92.   result is TRUE (-1) if Button is pressed or
  93.   FALSE (0) if Button isn't.
  94.  
  95. BUGS
  96.  
  97. SEE ALSO
  98.  
  99.   Fire (Amos Manual)
  100.  
  101.   Sticks.lib/Stick Joy         Sticks.lib/Stick Joy
  102.  
  103. NAME
  104.  
  105.   state = Stick Joy(jport)
  106.  
  107. FUNCTION
  108.   
  109.   Reads the joysticks that are plugged in the serial port
  110.  and returns in state.
  111.  
  112.  example:
  113.   Do
  114.      J=Stick Joy(1)
  115.      Print Bin$(J)
  116.   Loop
  117.  
  118. INPUTS
  119.  
  120.    jport - serial joystick port to test.
  121.            this is either 0 or 1
  122.  
  123. RESULTS
  124.     
  125.     1     Joystick moved up
  126.     2     Joystick moved down
  127.     4     Joystick moved left
  128.     8     Joystick moved right
  129.    16     Joystick fire1
  130.     
  131. BUGS
  132.  
  133.   none known
  134.  
  135. SEE ALSO
  136.  
  137.   Stick Left , Stick Right , Stick Up ,
  138.   Stick Down , Stick Fire , Multi Joy and Joy (AMOS MANUAL)
  139.  
  140. Sticks.lib/Stick Up          Sticks.lib/Stick Up
  141.  
  142. NAME
  143.  
  144.   BOOL = Stick Up(jport)
  145.  
  146. FUNCTION
  147.  
  148.  Test to see if joystick has been moved up  
  149.  
  150. INPUTS
  151.  
  152.  jport - serial joystick port to read
  153.  
  154. RESULTS
  155.  
  156.  TRUE if joystick is pushed up.
  157.  
  158. BUGS
  159.  
  160.  none known 
  161.  
  162. SEE ALSO
  163.  
  164.  Stick Joy,Multi Joy
  165.  
  166.  Sticks.lib/Stick Down        Sticks.lib/Stick Down
  167.  
  168. NAME
  169.  
  170.   BOOL = Stick Down(jport)
  171.  
  172. FUNCTION
  173.  
  174.  Test to see if joystick has been moved down.
  175.  
  176. INPUTS
  177.  
  178.  jport - Serial Joystick port to read
  179.  
  180. RESULTS
  181.  
  182.  TRUE if joystick is pushed down.
  183.  
  184. BUGS
  185.  
  186.  none known 
  187.  
  188. SEE ALSO
  189.  
  190.  Multi Joy,Stick Joy
  191.  
  192.  Sticks.lib/Stick Left         Sticks.lib/Stick Left
  193.  
  194. NAME
  195.  
  196.   BOOL = Stick Left(jport)
  197.  
  198. FUNCTION
  199.  
  200.  Test to see if joystick has been moved left.
  201.  
  202. INPUTS
  203.  
  204.  jport - Serial Joystick port to read
  205.  
  206. RESULTS
  207.  
  208.  TRUE if joystick is pushed left.
  209.  
  210. BUGS
  211.  
  212.  none known 
  213.  
  214. SEE ALSO
  215.  
  216.  Multi Joy,Stick Joy
  217.  
  218.  Sticks.lib/Stick Right        Sticks.lib/Stick Right
  219.  
  220. NAME
  221.  
  222.   BOOL = Stick Right(jport)
  223.  
  224. FUNCTION
  225.  
  226.  Test to see if joystick has been moved Right.
  227.  
  228. INPUTS
  229.  
  230.  jport - Serial Joystick port to read
  231.  
  232. RESULTS
  233.  
  234.  TRUE if joystick is pushed Right.
  235.  
  236. BUGS
  237.  
  238.  none known 
  239.  
  240. SEE ALSO
  241.  
  242.  Multi Joy,Stick Joy
  243.  
  244.  Sticks.lib/Stick Fire      Sticks.lib/Stick Fire
  245.  
  246. NAME
  247.  
  248.   BOOL = Stick Fire(jport)
  249.      
  250. FUNCTION
  251.  
  252.  Test to see if joystick has been moved fire.
  253.  
  254. INPUTS
  255.  
  256.  jport - Serial Joystick port to read
  257.  
  258. RESULTS
  259.  
  260.  TRUE if joystick is pushed fire.
  261.  
  262. BUGS
  263.  
  264.  I  shouldn't really tell you this because you will just go out and try it,
  265. but  if  you  enter =Stick Fire(Jport,button) it will return an error (This
  266. command  has  been  provided  so  it  can  be easily updated to handle more
  267. buttons in later version.)
  268.  
  269. SEE ALSO
  270.  
  271.  Multi Joy,Stick Joy
  272.  
  273.  Sticks.lib/Stick Scan        Sticks.lib/Stick Scan
  274.  
  275. NAME
  276.   
  277.  Stick Scan()
  278.  
  279. FUNCTION
  280.  
  281.  This  is an optomized version of the 'Analog Scan' Function in the Shuffle
  282. extension .
  283.  
  284.  This  command  scans  the  analog  joysticks to find their current values.
  285. this would normally be done 1 vbl before reading the sticks.
  286.  
  287. INPUTS
  288.  
  289. none  
  290.  
  291. RESULTS
  292.  
  293. none
  294.  
  295. BUGS
  296.  
  297. none known
  298.  
  299. SEE ALSO
  300.  
  301.  Club Newsletter Vol2 Issue2
  302.  
  303.  Sticks.lib/Stick X        Sticks.lib/Stick X
  304.  
  305. NAME
  306.  
  307.  value = Stick X(jport)
  308.  
  309. FUNCTION
  310.  
  311.  returns the X co-ordinate of the analog stick.  
  312.  
  313. INPUTS
  314.  
  315.  jport - Joystick Port to read.
  316.  
  317. RESULTS
  318.  
  319.  X co-ordinate (0-255)
  320.  
  321. BUGS
  322.  
  323.  none known
  324.  
  325. SEE ALSO
  326.  
  327.  Club Newsletter Vol2 Issue2 , Stick Y
  328.  
  329.  Sticks.lib/Stick Y        Sticks.lib/Stick Y
  330.  
  331. NAME
  332.  
  333.  Stick Y()
  334.  
  335.  value = Stick Y(jport)
  336.  
  337. FUNCTION
  338.  
  339.  returns the co-ordinate of the analog stick.
  340.  
  341.  
  342. INPUTS
  343.  
  344.  jport - Joystick Port to read.
  345.  
  346. RESULTS
  347.  
  348.  Y co-ordinate (0-255)   
  349.  
  350. BUGS
  351.  
  352.  none known
  353.  
  354. SEE ALSO
  355.  
  356.  Club Newsletter Vol2 Issue2 , Stick X
  357.  
  358.  Sticks.lib/Mouse X        Sticks.lib/Mouse X
  359.  
  360. NAME
  361.  
  362.   (1)  = Mouse X(Mouse Number)
  363.  
  364.   (2)  Mouse X Mouse Number,X co-ords
  365.  
  366. FUNCTION
  367.  
  368.   (1)  Reports the current X co-ordinate for the mouse, or sets the 
  369.        X co-ordinate for the mouse.
  370.  
  371.   (2)  Set the X position for the Mouse.
  372.   
  373.   The  mouse  position  is limited to the size set using the Mouse Clip and
  374. defaults to the default screen size.
  375.   
  376.  Note.   (1,2)  This  function  does  not  alter  or  read the AMOS pointer
  377.          position to do so you should use the X Mouse function.
  378.  
  379. INPUTS
  380.  
  381.  (1) Mouse Number - mouse you want to test (0 - 1)
  382.  
  383.  (2) Mouse Number - mouse to affect.
  384.      X co-ord     - mouse X position
  385.      
  386. RESULTS
  387.  
  388.  (1) The X co-ordinate of the mouse.
  389.  
  390.  (2) NO result.
  391.  
  392. BUGS
  393.  
  394.  In the last manual there was an error with both Mouse X and Mouse Y.
  395.  instead of 'Mouse X = value' (as stated) use 'Mouse X Mouse Number,value'
  396.  (Sorry)
  397.     
  398. SEE ALSO
  399.  
  400.  X mouse , Y mouse , Mouse Y , Smouse X , Smouse Y
  401.  
  402.  Sticks.lib/Mouse Y        Sticks.lib/Mouse Y
  403.  
  404. NAME
  405.  
  406.   (1)  = Mouse Y(mouse number)
  407.   
  408.   (2)  Mouse Y  mouse number,Y co-ords
  409.  
  410. FUNCTION
  411.  
  412.   (1) Reports the current Y co-ordinate for the mouse, or sets the 
  413.        Y co-ordinate for the mouse.
  414.  
  415.       The mouse position is limited to the size set using the 
  416.       Mouse House and defaults to the default screen size.
  417.     
  418.   (2) Sets the Y co-ord for the Mouse.
  419.   
  420.    Note.   (1,2)  This  function  does  not  alter or read the AMOS pointer
  421.            position to do so you should use the Y Mouse function.
  422.  
  423. INPUTS
  424.  
  425.  (1) Mouse number  - mouse you want to test (0 - 1)
  426.  
  427.  (2) Mouse Number  - mouse to affect.
  428.      Y co-ords      - New position for mouse Y().
  429.  
  430. RESULTS
  431.  
  432.  (1) The Y co-ordinate of the mouse.
  433.  
  434.  (2) No result.
  435.  
  436. BUGS
  437.  
  438.  none known.
  439.  
  440. SEE ALSO
  441.  
  442.  X mouse , Y mouse , Mouse X , Smouse X , Smouse Y
  443.  
  444.  Sticks.lib/Mouse Button     Sticks.lib/Mouse Button
  445.  
  446. NAME
  447.    
  448.   = Mouse Button(jport)
  449.  
  450. FUNCTION
  451.  
  452.   This function is used to see if any of the mouse buttons are pressed.
  453.   
  454. INPUTS
  455.  
  456.   jport - Which joystick port to read from
  457.  
  458. RESULTS
  459.   
  460.   0     No Buttons Pressed
  461.   1     Left Button Pressed
  462.   2     Right Button Pressed
  463.   3     Middle Button Pressed
  464.  
  465. BUGS
  466.  
  467.  none known
  468.  
  469. SEE ALSO
  470.  
  471.  Sticks.lib/Mouse Clip      Sticks.lib/Mouse Clip
  472.  
  473. NAME
  474.  
  475.  (1) Mouse Clip Mouse Number,minx,miny To maxx,maxy
  476.  
  477.  (2) Mouse Clip Mouse Number
  478.  
  479. FUNCTION
  480.  
  481.  (1)  This will Limit the mouse to an area on the screen or even beyond the
  482.       screen  if  you  want  each of the mice can be limited to a different
  483.       area and these can overlap as needed.
  484.       When  you  call  the  Default function all Limits are set back to the
  485.       Default screen size.
  486.  
  487.  (2) Sets the Mouse Limit to the current screen size.
  488.  
  489. INPUTS
  490.  
  491.  (1) Mouse Number - The mouse you want to limit
  492.      minx - The left of the box       
  493.      miny - The top of the box
  494.      maxx - The right of the box
  495.      maxy - The bottom of the box
  496.  
  497.  (2) Mouse Number - The mouse you want to clip
  498.      this will limit the mouse to the current screen size.
  499.           
  500. RESULTS
  501.   
  502.  (1,2) The mouse cannot move out of the box.
  503.  
  504. BUGS
  505.  
  506. SEE ALSO
  507.  
  508.  Smouse Clip
  509.  
  510.  Sticks.lib/Mouse Area         Sticks.lib/Mouse Area
  511.  
  512. NAME
  513.  
  514.  =Mouse Area (Mouse Number)
  515.  
  516. FUNCTION
  517.  
  518.  This Command will return the Zone the mouse is over.
  519.  This function is the same as Mouse Zone in AMOS except Mouse Zone can only
  520.  read one mouse.
  521.  
  522. INPUTS
  523.  
  524.  Mouse Number - Mouse to check for zones.
  525.           
  526. RESULTS
  527.   
  528.  The zone the mouse is over.
  529.  
  530. BUGS
  531.  
  532.  No bugs in the command just the old manual. Sorry all ,read above for 
  533.  how Mouse Area really works.
  534.  
  535.